import { createRouter, createWebHashHistory } from 'vue-router'

const router = createRouter({
  history: createWebHashHistory(), // hash模式：createWebHashHistory，history模式：createWebHistory
  // 公共路由，所有用户和权限都可以访问的
  routes: [
    {
      path: '/',
      name: 'index',
      meta: {
        title: '主页',
        isRoot: true
      },
      component: () => import(/* webpackChunkName: "Log" */ '../views/Index.vue')
    },
    {
      path: '/:pathMatch(.*)*',
      component: () => import('@/views/error/404.vue'),
      hidden: true
    },
    {
      path: '/login',
      name: 'login',
      meta: {
        title: '登录'
      },
      component: () => import(/* webpackChunkName: "Log" */ '../views/Login.vue')
    },
    {
      path: '/port',
      name: 'port',
      meta: {
        title: '接口'
      },
      component: () => import(/* webpackChunkName: "Log" */ '../views/network/Port.vue')
    },
    {
      path: '/net-bridging',
      name: 'net-bridging',
      meta: {
        title: '网口桥接'
      },
      component: () => import(/* webpackChunkName: "Log" */ '../views/network/NetBridging.vue')
    },
    {
      path: '/time-sync',
      name: 'time-sync',
      meta: {
        title: '时间同步'
      },
      component: () => import(/* webpackChunkName: "Log" */ '../views/application/TimeSync.vue')
    },
    {
      path: '/ftp-set',
      name: 'ftp-set',
      meta: {
        title: 'FTP设置'
      },
      component: () => import(/* webpackChunkName: "Log" */ '../views/application/FTPSet.vue')
    },
    {
      path: '/mail-alarm-set',
      name: 'mail-alarm-set',
      meta: {
        title: '邮件告警设置'
      },
      component: () => import(/* webpackChunkName: "Log" */ '../views/application/MailAlarmSet.vue')
    },
    {
      path: '/snmp-set',
      name: 'snmp-set',
      meta: {
        title: 'SNMP设置'
      },
      component: () => import(/* webpackChunkName: "Log" */ '../views/application/SnmpSet.vue')
    },
    {
      path: '/mac-set',
      name: 'mac-set',
      meta: {
        title: 'MAC地址过滤设置'
      },
      component: () => import(/* webpackChunkName: "Log" */ '../views/application/MacSet.vue')
    },
    {
      path: '/basic-alarm',
      name: 'basic-alarm',
      meta: {
        title: '基本告警'
      },
      component: () => import(/* webpackChunkName: "Log" */ '../views/application/BasicAlarm.vue')
    },
    {
      path: '/power-alarm',
      name: 'power-alarm',
      meta: {
        title: '掉电告警设置'
      },
      component: () => import(/* webpackChunkName: "Log" */ '../views/application/PowerDownAlarm.vue')
    },

    {
      path: '/update-password',
      name: 'update-password',
      meta: {
        title: '修改密码'
      },
      component: () => import(/* webpackChunkName: "Log" */ '../views/users/UpdatePassword.vue')
    },
    {
      path: '/serial-interface',
      name: 'serial-interface',
      meta: {
        title: '串行接口设置'
      },
      component: () => import(/* webpackChunkName: "Log" */ '../views/serial-server/SerialTab.vue')
    },
    {
      path: '/state',
      name: 'state',
      meta: {
        title: '状态信息'
      },
      component: () => import(/* webpackChunkName: "Log" */ '../views/serial-server/State.vue')
    },
    {
      path: '/extra-config',
      name: 'extra-config',
      meta: {
        title: '额外配置'
      },
      component: () => import(/* webpackChunkName: "Log" */ '../views/serial-server/ExtraConfig.vue')
    },
    {
      path: '/protocol-config',
      name: 'protocol-config',
      meta: {
        title: '协议配置概况'
      },
      component: () => import(/* webpackChunkName: "Log" */ '../views/data-collect/ProtocolConfig.vue')
    },
    {
      path: '/edps-upgrade',
      name: 'edps-upgrade',
      meta: {
        title: 'EDPS升级'
      },
      component: () => import(/* webpackChunkName: "Log" */ '../views/data-collect/EdpsUpgrade.vue')
    },
    {
      path: '/edps-auth',
      name: 'edps-auth',
      meta: {
        title: 'EDPS授权'
      },
      component: () => import(/* webpackChunkName: "Log" */ '../views/data-collect/EdpsAuth.vue')
    },
    {
      path: '/log',
      name: 'log',
      meta: {
        title: '日志'
      },
      component: () => import(/* webpackChunkName: "Log" */ '../views/system/Log.vue')
    }
  ]
})

export default router